package com.py.credit.dao;

import org.apache.ibatis.annotations.Param;

import com.py.credit.entity.IndexCatModel;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @Company: WWW.xypy.com.cn
 * @ClassName UserEvaInfoDao
 * @Description: 信用评价DAO层
 * @Author: YaoS
 * @Create: 2018-10-24 11:43
 **/
public interface UserEvaInfoDao {
    /**
     * 查询模版
     *
     * @param zone
     * @param industry
     * @param reportType
     * @return String
     * @author YaoS
     * @date 11:49 18/10/24
     **/
    String selectModel(@Param(value = "zone") String zone,
                       @Param(value = "industry") String industry,
                       @Param(value = "reportType") String reportType);

    /**
     * 查询指标目录
     *
     * @param modelId
     * @param type
     * @param parentId
     * @return ArrayList
     * @author YaoS
     * @date 19:19 18/10/25
     **/
    ArrayList<Map<String, Object>> selectCategory(@Param(value = "modelId") String modelId,
                                                  @Param(value = "type") String type,
                                                  @Param(value = "parentId") String parentId);

    ArrayList<Map<String, Object>> selectCategoryOnModel(
            @Param(value = "modelId") String modelId,
            @Param(value = "sqr") String sqr
    );

    /**
     * TODO
     *
     * @param
     * @return
     * @author YaoS
     * @date 13:54 18/10/27
     **/
    Map<String, Object> selectCategoryDetail(@Param(value = "indexOrCatId") String indexOrCatId);

    /**
     * 查询所有指标
     *
     * @param indexOrCatId
     * @return ArrayList
     * @author YaoS
     * @date 11:40 18/10/26
     **/
    Map<String, Object> selectIndex(@Param(value = "indexOrCatId") String indexOrCatId);

    /**
     * 插入index到xypj_index_model_data表
     *
     * @param indexList
     * @return
     * @author YaoS
     * @date 11:43 18/10/27
     **/
    void insertIndex(List<Map<String, String>> indexList);

    void insertEvalInfo(Map m);

    String getSlbh();

    String getBgbh(@Param(value = "bm") String bm, @Param(value = "modelId") String modelId);

    String selectEvainfoId(@Param(value = "sqr") String sqr);

    /**
     * 查看状态位
     *
     * @param
     * @return
     * @author YaoS
     * @date 10:16 18/11/7
     **/
    String selectStatusByModel(
            @Param(value = "sqr") String sqr,
            @Param(value = "modelId") String modelId

    );

    public List<String> getReturnIndexId(@Param(value = "evainfoId") String evainfoId);


    public Integer selectOrgAndModel(@Param(value = "reportType") String reportType, @Param(value = "orgId") String orgId);

    public void updateDelFlag(@Param(value = "evalinfoId") String evalinfoId);

    public Integer selectExistReport(@Param(value = "modelId") String modelId, @Param(value = "orgId") String orgId, @Param(value = "sqr") String sqr);

    /**
     * 查询可选的报告类型
     *
     * @param zone     地区
     * @param industry 行业
     * @param scoreType 处分类型
     * @return List 报告list
     * @author YaoS
     * @date 14:19 18/12/25
     **/
    List<String> selectReport(@Param(value = "zone") String zone,
                              @Param(value = "scoreType") String scoreType,
                              @Param(value = "industry") String industry);
}
